package com.mvvm.store.roombatabase;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.mvvm.store.bean.basebean.ScanStockBean;
import com.mvvm.store.bean.basebean.StockUpScanInfoBean;

import java.util.List;

/**
 * 标签存储
 */

@Dao
public interface ScanStockDao {

    //查询标签是否存在
    @Query("SELECT * FROM ScanStockBean WHERE lableNumber=:lableNumber")
    List<ScanStockBean> getScanStockBeanByLableNumber(String lableNumber);

    @Query("SELECT * FROM ScanStockBean WHERE oddNumber=:oddNumber")
    List<ScanStockBean> getScanStockBeanByOddNumber(String oddNumber);

    //新增扫码数据
    @Insert
    void insertAll(ScanStockBean... stockUpInfoBean);

    //修改单挑记录
    @Update
    void updateStudent(ScanStockBean... users);

    //删除对于的备案数据
    @Delete
    void delete(ScanStockBean user);


    //根据id查询对于的物料信息
    @Query("SELECT *FROM ScanStockBean WHERE sId=:sId")
    List<ScanStockBean> getScanStockBeanById(int sId);
}
